There is a conventional image processing apparatus that can perform image processing on a captured image frame by frame and diagnose a failure of an image processing circuit frame by frame. The image processing apparatus performs the failure diagnosis during an idle time for the image processing by the image processing circuit after completion of the image processing for an arbitrary frame before starting image processing for a subsequent frame. The failure diagnosis of the image processing circuit includes transmitting a scan test pattern to the image processing circuit and comparing the scan test result obtained from the image processing circuit with an expected value.
The time required for image processing on image data of one frame is variable depending on congestion of a system bus. For example, when abnormal interrupt processing or the like arises, the timing when the image processing completes may be greatly delayed due to the congestion of the system bus. When the completion timing of the image processing is delayed, the failure diagnosis cannot be completed before the timing to start the image processing for the subsequent frame, and will be stopped. If the scan test is discarded when the failure diagnosis is not able to be completed, the failure diagnosis is useless and becomes a cause of power waste. As an alternative way, when the failure diagnosis processing is interrupted in the image processing of subsequent frame, it may be possible to continue the failure diagnosis processing after the image processing of the subsequent frame. However, in such a case, an appropriate circuit will be additionally required to save the uncompleted scan test result of each register of the image processing circuit. In addition, another circuit will be required to return the uncompleted scan test result to each register of the image processing circuit before continuing the failure diagnosis processing. As a result, a problem that the circuit scale becomes larger arises.